﻿// --------------------------------
// <copyright file="GameListTest.cs" company="Pattern Web Solutions">
//     Copyright © Simon Gill 2010. Distributed under the GPL.
// </copyright>
// <author>Simon Gill</author>
// ---------------------------------
// This file is part of LeagueManager.Tests

// LeagueManager.Tests is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 2 of the License, or
// (at your option) any later version.

// LeagueManager.Tests is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with LeagueManager.Tests.  If not, see <http://www.gnu.org/licenses/>.

namespace LeagueManager.Tests
{
    using System;
    using LeagueManager;
    using LeagueManager.Models;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    
    /// <summary>
    /// This is a test class for GameListTest and is intended
    /// to contain all GameListTest Unit Tests
    /// </summary>
    [TestClass()]
    public class GameListTest
    {
        private TestContext testContextInstance;

        /// <summary>
        /// Gets or sets the test context which provides
        /// information about and functionality for the current test run.
        /// </summary>
        public TestContext TestContext
        {
            get
            {
                return this.testContextInstance;
            }

            set
            {
                this.testContextInstance = value;
            }
        }

        #region Additional test attributes

        // You can use the following additional attributes as you write your tests:
        
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext)
        // {
        // }
        
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup()
        // {
        // }
        
        // Use TestInitialize to run code before running each test
        // [TestInitialize()]
        // public void MyTestInitialize()
        // {
        // }
        
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup()
        // {
        // }
        #endregion

        /// <summary>
        /// A test for lstGames_SelectedIndexChanged
        /// </summary>
        [TestMethod()]
        [DeploymentItem("LeagueManager.exe")]
        [Ignore]
        public void Games_SelectedIndexChangedTest()
        {
            PrivateObject param0 = null; // TODO: Initialize to an appropriate value
            GameList_Accessor target = new GameList_Accessor(param0); // TODO: Initialize to an appropriate value
            object sender = null; // TODO: Initialize to an appropriate value
            EventArgs e = null; // TODO: Initialize to an appropriate value
            target.Games_SelectedIndexChanged(sender, e);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        /// <summary>
        /// A test for LoadGames
        /// </summary>
        [TestMethod()]
        [DeploymentItem("LeagueManager.exe")]
        [Ignore]
        public void LoadGamesTest()
        {
            PrivateObject param0 = null; // TODO: Initialize to an appropriate value
            GameList_Accessor target = new GameList_Accessor(param0); // TODO: Initialize to an appropriate value
            target.LoadGames();
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        /// <summary>
        /// A test for InitializeComponent
        /// </summary>
        [TestMethod()]
        [DeploymentItem("LeagueManager.exe")]
        [Ignore]
        public void InitializeComponentTest()
        {
            PrivateObject param0 = null; // TODO: Initialize to an appropriate value
            GameList_Accessor target = new GameList_Accessor(param0); // TODO: Initialize to an appropriate value
            target.InitializeComponent();
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        /// <summary>
        /// A test for Dispose
        /// </summary>
        [TestMethod()]
        [DeploymentItem("LeagueManager.exe")]
        [Ignore]
        public void DisposeTest()
        {
            PrivateObject param0 = null; // TODO: Initialize to an appropriate value
            GameList_Accessor target = new GameList_Accessor(param0); // TODO: Initialize to an appropriate value
            bool disposing = false; // TODO: Initialize to an appropriate value
            target.Dispose(disposing);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        /// <summary>
        /// A test for btnToggleActive_Click
        /// </summary>
        [TestMethod()]
        [DeploymentItem("LeagueManager.exe")]
        [Ignore]
        public void ToggleActive_ClickTest()
        {
            PrivateObject param0 = null; // TODO: Initialize to an appropriate value
            GameList_Accessor target = new GameList_Accessor(param0); // TODO: Initialize to an appropriate value
            object sender = null; // TODO: Initialize to an appropriate value
            EventArgs e = null; // TODO: Initialize to an appropriate value
            target.ToggleActive_Click(sender, e);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        /// <summary>
        /// A test for btnAddGame_Click
        /// </summary>
        [TestMethod()]
        [DeploymentItem("LeagueManager.exe")]
        [Ignore]
        public void AddGame_ClickTest()
        {
            PrivateObject param0 = null; // TODO: Initialize to an appropriate value
            GameList_Accessor target = new GameList_Accessor(param0); // TODO: Initialize to an appropriate value
            object sender = null; // TODO: Initialize to an appropriate value
            EventArgs e = null; // TODO: Initialize to an appropriate value
            target.AddGame_Click(sender, e);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        /// <summary>
        /// A test for GameList Constructor. Tests bug #7180, Games List crashes when loaded if there are no games in the repository.
        /// </summary>
        /// <see href="http://gslm.codeplex.com/WorkItem/View.aspx?WorkItemId=7180">Bug #7180</see>
        [TestMethod()]
        public void GameListConstructorTest()
        {
            IMembershipRepository repository = new LeagueManager.Tests.Models.EmptyMembershipRepository(); // TODO: Initialize to an appropriate value
            GameList target = new GameList(repository);
            
            // Pass if there is no exception.
        }
    }
}
